package com.cicigodd.brick.plug.system.menu.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cicigodd.brick.plug.common.entity.BaseEntity;
import com.cicigodd.brick.plug.common.tree.factory.base.AbstractTreeNode;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * 菜单管理
 *
 * @author cicigodd
 * @date 2022/12/12 16:28:23
 */
@TableName("sys_menu")
@Data
public class SysMenu extends BaseEntity implements AbstractTreeNode<SysMenu> {

    @ApiModelProperty("id")
    private Integer id;

    @ApiModelProperty("菜单父id")
    private Integer parentId;

    @ApiModelProperty("父id集合")
    private String menuPids;

    @ApiModelProperty("菜单名称")
    private String menuName;

    @ApiModelProperty("菜单类型")
    private String menuType;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("菜单图标")
    private String icon;

    @ApiModelProperty("路由地址")
    private String router;

    @ApiModelProperty("组件路径")
    private String component;

    @ApiModelProperty("权限字符")
    private String perms;

    @ApiModelProperty("显示状态")
    private String visible;

    @ApiModelProperty("状态")
    private String statusFlag;

    @TableField(exist = false)
    @ApiModelProperty("子节点（表中不存在，用于构造树）")
    private List<SysMenu> children;

    @TableField(exist = false)
    @ApiModelProperty("父级菜单的名称")
    private String menuParentName;

    @TableField(exist = false)
    @ApiModelProperty("是否是叶子节点菜单")
    private Boolean leafFlag;

    @Override
    public String getNodeId() {
        return id.toString();
    }

    @Override
    public String getNodeParentId() {
        return parentId.toString();
    }

    @Override
    public void setChildrenNodes(List<SysMenu> childrenNodes) {
        this.children = childrenNodes;
    }
}